package com.jm.day24.d_demo2.service;

import com.jm.day24.d_demo2.dao.AccountDao;

public class AccountService {


    public boolean transfer(String out, String in, Double money){
        boolean isSuccess = true;

        AccountDao dao = new AccountDao();

        try{
            //执行转账人扣钱
            dao.out(out, money);

            //手动创建异常
           // int i = 1/0;

            //执行收款人加钱
            dao.in(in, money);
        }catch (Exception e){
            isSuccess = false;

        }

        return isSuccess;
    }
}

